package com.ihrm.system.service.Impl;

import com.ihrm.domain.system.RolePermission;
import com.ihrm.system.dao.RolePermissionDao;
import com.ihrm.system.service.RolePermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Service
@Transactional
public class RolePermissionServiceImpl implements RolePermissionService {
    @Autowired
    private RolePermissionDao rolePermissionDao;

    @Override
    public void update(Map<String , Object> map) {
        rolePermissionDao.delByRoleId((String) map.get("id"));
        if(((List) map.get("permIds")).size() > 0) {
            rolePermissionDao.insertBatch(map);
        }
    }
}
